package com.example.Laboratory.Mapper;


import com.example.Laboratory.Entity.Backbone;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BackboneMapper {
    //添加学科骨干信息
    @Insert("INSERT INTO backbone(backbone_name,backbone_duty,backbone_major,backbone_education,backbone_degree,backbone_direction,backbone_thesis_achievement_name1,backbone_thesis_grade_unit_time1,backbone_number_sign1,backbone_thesis_achievement_name2,backbone_thesis_grade_unit_time2,backbone_number_sign2,backbone_thesis_achievement_name3,backbone_thesis_grade_unit_time3,backbone_number_sign3,backbone_project_name1,backbone_project_source1,backbone_project_time1,backbone_project_money1,backbone_project_work1,backbone_project_name2,backbone_project_source2,backbone_project_time2,backbone_project_money2,backbone_project_work2,backbone_project_name3,backbone_project_source3,backbone_project_time3,backbone_project_money3,backbone_project_work3)" +
            "VALUES(#{backbone_name},#{backbone_duty},#{backbone_major},#{backbone_education},#{backbone_degree},#{backbone_direction},#{backbone_thesis_achievement_name1},#{backbone_thesis_grade_unit_time1},#{backbone_number_sign1},#{backbone_thesis_achievement_name2},#{backbone_thesis_grade_unit_time2},#{backbone_number_sign2},#{backbone_thesis_achievement_name3},#{backbone_thesis_grade_unit_time3},#{backbone_number_sign3},#{backbone_project_name1},#{backbone_project_source1},#{backbone_project_time1},#{backbone_project_money1},#{backbone_project_work1},#{backbone_project_name2},#{backbone_project_source2},#{backbone_project_time2},#{backbone_project_money2},#{backbone_project_work2},#{backbone_project_name3},#{backbone_project_source3},#{backbone_project_time3},#{backbone_project_money3},#{backbone_project_work3})")
    int addBackbone (Backbone b);

    //根据id删除学科骨干信息
    @Delete("DELETE FROM backbone WHERE backbone_id=#{backbone_id}")
    int deleteBackbone (int backbone_id);

    //查找学科骨干信息
    @Select("SELECT * FROM backbone")
    List<Backbone> researchBackbone();

    //修改信息
    @Update("UPDATE backbone SET backbone_name=#{backbone_name},backbone_duty=#{backbone_duty},backbone_major=#{backbone_major},backbone_education=#{backbone_education},backbone_degree=#{backbone_degree},backbone_direction=#{backbone_direction},backbone_thesis_achievement_name1=#{backbone_thesis_achievement_name1},backbone_thesis_grade_unit_time1=#{backbone_thesis_grade_unit_time1},backbone_number_sign1=#{backbone_number_sign1},backbone_thesis_achievement_name2=#{backbone_thesis_achievement_name2},backbone_thesis_grade_unit_time2=#{backbone_thesis_grade_unit_time2},backbone_number_sign2=#{backbone_number_sign2},backbone_thesis_achievement_name3=#{backbone_thesis_achievement_name3},backbone_thesis_grade_unit_time3=#{backbone_thesis_grade_unit_time3},backbone_number_sign3=#{backbone_number_sign3}," +
            "backbone_project_name1=#{backbone_project_name1},backbone_project_source1=#{backbone_project_source1},backbone_project_time1=#{backbone_project_time1},backbone_project_money1=#{backbone_project_money1},backbone_project_work1=#{backbone_project_work1},backbone_project_name2=#{backbone_project_name2},backbone_project_source2=#{backbone_project_source2},backbone_project_time2=#{backbone_project_time2},backbone_project_money2=#{backbone_project_money2},backbone_project_work2=#{backbone_project_work2},backbone_project_name3=#{backbone_project_name3},backbone_project_source3=#{backbone_project_source3},backbone_project_time3=#{backbone_project_time3},backbone_project_money3=#{backbone_project_money3},backbone_project_work3=#{backbone_project_work3} WHERE backbone_id=#{backbone_id}")
    int reviseBackbone(Backbone b);
}
